<?php
if (!defined('LINKS_MEMORY_CHECK')) define('LINKS_MEMORY_CHECK', 1);//NE+

require '../../../mainfile.php';

//NE+
if (LINKS_MEMORY_CHECK === 1 && is_object($xoopsUser) && $xoopsUser->isAdmin() && function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
	list($usec, $sec) = explode(' ', microtime());
	$GLOBALS["LINKS_BENCH_ST"] = $usec + $sec;
	$GLOBALS["LINKS_MEMORY"][] =  memory_get_usage();
	$GLOBALS["LINKS_MEMORY"][] =  memory_get_usage(TRUE);
	$GLOBALS["LINKS_MEMORY"][] =  memory_get_peak_usage();
	$GLOBALS["LINKS_MEMORY"][] =  memory_get_peak_usage(TRUE);
}


$mydirname = basename(dirname(dirname(__FILE__)));
//$mydirpath = dirname(dirname(__FILE__));
require realpath(dirname(__FILE__)) . '/../mytrustdirname.php';
require XOOPS_TRUST_PATH . '/modules/' . $mytrustdirname . '/admin.php';


//NE+
if (LINKS_MEMORY_CHECK === 1 && is_object($xoopsUser) && $xoopsUser->isAdmin() && function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
	foreach ($GLOBALS["LINKS_MEMORY"] as $m) {
		echo $m, ' / ';
	}
	echo '<br />';
	echo memory_get_usage(), ' / ';
	echo memory_get_usage(TRUE), ' / ';
	echo memory_get_peak_usage(), ' / ';
	echo memory_get_peak_usage(TRUE), ' / ';
	list($usec, $sec) = explode(' ', microtime());
	$endtime = $usec + $sec;
	echo $endtime - $GLOBALS["LINKS_BENCH_ST"], '<br />';
}